package cn.zjnu.config;

import org.springframework.context.annotation.*;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.EnableTransactionManagement;

//Spring的设置
@Configuration
/*
    按照注解过滤（FilterType.ANNOTATION）所有的Controller注解的类，相当于排除了controller包内的组件，
    实现Spring扫描除controller包外的组件；SpringMVC扫描controller包内的组件
 */
@ComponentScan(value = "cn.zjnu",
        excludeFilters = @ComponentScan.Filter(
                type = FilterType.ANNOTATION, //按注解过滤
                classes = Controller.class  // 排除@Controller注解的类
        )
)
@PropertySource("classpath:jdbc.properties")//设置properties资源的地址
@Import({JdbcConfig.class,MyBatisConfig.class}) //导入数据库连接
@EnableTransactionManagement
public class SpringConfig {
}
